<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import=" vn.edu.ptithcm.helper.CKEditorConfigHelper" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
  <spring:message  code="pim"/> - <spring:message  code="edit.company" />
</title>
<link href="<%= request.getContextPath() %>/css/custom.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath() %>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath() %>/css/v.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.6.2.js"></script>
<%@include file="script/pim-util.jsp" %>
</head>
<body>
<c:if test="${bean.isSigned == true}">
<div id="all">
<div id="wrapper">
<div id="mainheader">
	<jsp:include page="include/common/headerSignedIn.jsp" />
</div> 
<div id="content-wrapper">
<div id="top-menu">
    <jsp:include page="include/common/topMenuHome.jsp" /> 
</div>
<div class="main-content">
<form:form action="" method="post" commandName="company">	   		  
<div>	
	<div class="v-row v-border-bottom" style="padding-top: 10px;">
		<div class="v-row-left" style="margin-left: 10px;">
			<span class="v-title">
			   <c:choose>
			     <c:when test="${bean.id =='careers' }"><spring:message  code="edit.career" /></c:when>
			     <c:when test="${bean.id =='technologies' }"><spring:message  code="edit.technology" /></c:when>
			     <c:when test="${bean.id =='fields' }"><spring:message  code="edit.field" /></c:when>
			     <c:otherwise><spring:message  code="edit.overview" /></c:otherwise>
			   </c:choose>				
			</span>
		</div>	
	</div>	
	<div class="v-body">
	<div class="v-row" id="v-global-message">
	   <c:if test="${editOK == true }">
	      	<span class="v-global-success-message v-row">
	      	    <span><spring:message  code="edit.company.success" /></span>
	      	</span>
	   </c:if>
	   <c:if test="${editOK == false }">
	      	<span class="v-global-error-message v-row">
	      	    <span><spring:message  code="edit.company.error" /></span>
	      	</span>
	    </c:if>
	</div>	
	<div style="margin-left: 40px;">
		<div class="v-row">
			<div class="v-row-left">
				<span class="v-required-title">
				    <spring:message code="title.required.field" />
				</span>
			</div>
		</div>	
		<div class="v-row">
			<div class="v-row-left">
				<span>
			     	<spring:message code="field.mandatory" />
				</span>
			</div>						
		</div>		
		
		<div class="v-row">						
			<div class="v-row-left">			   
				<span>
				 <c:choose>
				     <c:when test="${bean.id =='careers' }">
				        <form:textarea path="career"/>	
				     </c:when>
				     <c:when test="${bean.id =='technologies' }">
				       <form:textarea path="technology"/>	
				     </c:when>
				     <c:when test="${bean.id =='fields' }">
				       <form:textarea path="field"/>	
				     </c:when>
				     <c:otherwise>
				      <form:textarea path="overview"/>	
				     </c:otherwise>
			     </c:choose>				     		
				 </span>
				 <br/>
				 				
			</div>
		</div>		
		        				
		<div class="v-row">
		    <br/>
			<div class="v-row-center">
				<span>
				<input type="submit" class="bt-form" 
					        value="<spring:message code="button.save" />" />
				</span>				
				<span>
				<input type="button" class="bt-form"
						onclick="cancel('<c:out value='${bean.returnToFullPageURL }'/>')"
						value="<spring:message code="button.cancel"/>" />
				</span>
			</div>
		</div>
	</div>
</div>
</div>
<input type="hidden" name="returnToFullPageURL" value="${bean.returnToFullPageURL}"/>
</form:form>	 	
</div>	
</div>
</div>
<div class="footer">
	<jsp:include page="include/common/footer.jsp" />
</div>
</div>	
<c:choose>
    <c:when test="${bean.id =='careers' }">
       <ckeditor:replace basePath="/ckeditor/" replace="career" config="<%= CKEditorConfigHelper.createConfig(875,400) %>"/>	
    </c:when>
    <c:when test="${bean.id =='technologies' }">
      <ckeditor:replace basePath="/ckeditor/" replace="technology" config="<%= CKEditorConfigHelper.createConfig(875,400) %>"/>
    </c:when>
    <c:when test="${bean.id =='fields' }">
      <ckeditor:replace basePath="/ckeditor/" replace="field" config="<%= CKEditorConfigHelper.createConfig(875,400) %>"/>
    </c:when>
    <c:otherwise>
     <ckeditor:replace basePath="/ckeditor/" replace="overview" config="<%= CKEditorConfigHelper.createConfig(875,400) %>"/>
    </c:otherwise>
</c:choose>			   
</c:if>
</body>
</html>	